package org.springblade.modules.digitalization.vo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springblade.modules.digitalization.entity.ManageRsdamlEntity;

import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Data
public class CatalogItem {

    /**
     * 目录id
     */
    private String id;
    private String parentId;
    private List<CatalogItem> children;
    @JsonIgnore
    private CatalogItem parent;
    /**
     * 类号
     */
    @ApiModelProperty(value = "类号")
    private String classNo;


    /**
     * 目录唯一标识
     */
    @ApiModelProperty(value = "目录唯一标识")
    private String rsdaml000;
    /**
     * 档案ID
     */
    @ApiModelProperty(value = "档案ID")
    private String archiveId;
    /**
     * 人员挂接标识RSDAML001     人员主键
     */
    @ApiModelProperty(value = "人员挂接标识RSDAML001     人员主键")
    private String a0000;
    /**
     * 类号
     */
    @ApiModelProperty(value = "类号")
    private String rsdaml002;
    /**
     * 序号
     */
    @ApiModelProperty(value = "序号")
    private Integer rsdaml003;
    /**
     * 材料名称
     */
    @ApiModelProperty(value = "材料名称")
    private String rsdaml004;
    /**
     * 页数
     */
    @ApiModelProperty(value = "页数")
    @JsonSerialize(nullsUsing = NullSerializer.class)
    private Integer rsdaml005;
    /**
     * 时间年YYYY
     */
    @ApiModelProperty(value = "时间年YYYY")
    private String rsdaml006;
    /**
     * 时间月MM
     */
    @ApiModelProperty(value = "时间月MM")
    private String rsdaml007;
    /**
     * 时间日DD
     */
    @ApiModelProperty(value = "时间日DD")
    private String rsdaml008;
    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    private String rsdaml009;
    /**
     * 版本
     */
    @ApiModelProperty(value = "版本")
    private String rsdamlVersion;

	@Override
	public String toString() {
		return "CatalogItem{" +
			"id='" + id + '\'' +
			", parentId='" + parentId + '\'' +
			", children=" + children +
			", classNo='" + classNo + '\'' +
			", rsdaml000='" + rsdaml000 + '\'' +
			", archiveId='" + archiveId + '\'' +
			", a0000='" + a0000 + '\'' +
			", rsdaml002='" + rsdaml002 + '\'' +
			", rsdaml003=" + rsdaml003 +
			", rsdaml004='" + rsdaml004 + '\'' +
			", rsdaml005=" + rsdaml005 +
			", rsdaml006='" + rsdaml006 + '\'' +
			", rsdaml007='" + rsdaml007 + '\'' +
			", rsdaml008='" + rsdaml008 + '\'' +
			", rsdaml009='" + rsdaml009 + '\'' +
			", rsdamlVersion='" + rsdamlVersion + '\'' +
			'}';
	}

	public CatalogItem() {

    }
    public CatalogItem(ManageRsdamlEntity rsdaml) {
    	this.id=rsdaml.getId().toString();
    	this.classNo=rsdaml.getRsdaml002();
		this.archiveId=rsdaml.getArchiveId();
    	this.children=new ArrayList<CatalogItem>();
    	this.rsdaml000=rsdaml.getRsdaml000();
    	this.rsdaml002=rsdaml.getRsdaml002();
    	this.rsdaml003=rsdaml.getRsdaml003();
    	this.rsdaml004=rsdaml.getRsdaml004();
    	this.rsdaml005=rsdaml.getRsdaml005();
    	this.rsdaml006=rsdaml.getRsdaml006();
    	this.rsdaml007=rsdaml.getRsdaml007();
    	this.rsdaml008=rsdaml.getRsdaml008();
    	this.rsdaml009=rsdaml.getRsdaml009();
    	this.rsdamlVersion=rsdaml.getRsdamlVersion();
    	this.a0000=rsdaml.getA0000();
    }

    public CatalogItem(String id, String parentId, String classNo, List<CatalogItem> children, String rsdaml000,
                       String archiveId, String a0000, String rsdaml002, Integer rsdaml003, String rsdaml004, Integer rsdaml005, String rsdaml006, String rsdaml007, String rsdaml008, String rsdaml009, String rsdamlVersion) {
        this.id = id;
        this.parentId = parentId;
        this.classNo = classNo;
        this.children = children;
        this.rsdaml000 = rsdaml000;
        this.archiveId = archiveId;
        this.a0000 = a0000;
        this.rsdaml002 = rsdaml002;
        this.rsdaml003 = rsdaml003;
        this.rsdaml004 = rsdaml004;
        this.rsdaml005 = rsdaml005;
        this.rsdaml006 = rsdaml006;
        this.rsdaml007 = rsdaml007;
        this.rsdaml008 = rsdaml008;
        this.rsdaml009 = rsdaml009;
        this.rsdamlVersion = rsdamlVersion;
    }

}
